********Figure D.1 - Mexico********

*Load data
cd "$reploc/data/created_data"
use mex_full, clear

drop if mxfls==.

clonevar mxfls2 = mxfls 
label define mxflslab 2 "MxFLS2" 3 "MxFLS3", modify
label values mxfls2  mxflslab

sort pid_link mxfls
drop if mxfls==.
*keep if panel==1

*Do this analysis for full sample
sort pid_link mxfls
foreach var of varlist rbuc_nga rbuc grbrprovAvg_lam0co3 grbrprovSD_lam0co3 inflation{
gen `var'dif=`var'-`var'[_n-1] if mxfls==3 & pid_link==pid_link[_n-1]
} 

gen eithrisk=0
replace eithrisk=1 if rbucdif!=. 

egen fullsample=total(eithrisk), by(pid_link)

keep if fullsample==1

cd "$reploc/results"
hist rbucFULL, percent by(mxfls2, note(" ") graphregion(color(white))) discrete xlabel(1(1)7) fcolor(orange) lcolor(ebg)
graph export FigureD1Mexico.eps, replace
